package pattern3;

/**
 * 装饰类
 *
 * @author wdl
 */
abstract class AbstractFinery extends Person {
    protected Person personComponent;

    /**
     * 通过decorate也就是setPersonComponent对于被装饰的对象进行包装
     */
    public void decorate(Person personComponent) {
        this.personComponent = personComponent;
    }

    @Override
    public void show() {
        if (personComponent != null) {
            personComponent.show();
        }
    }
}


